<!-- 值班记录工作量统计 searchGzltj.jsp -->
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/js/validator.js"></script> 
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				       },'-',{
				            text: '统计',
				            icon:"<%=contextPath%>/images/hangye.png",
				            handler:function() {
				            	if(!Validator.Validate(frmM,2)){
				  					return false;
			  					}
  								jl();
				            
				            }
 						},'-',{
				            text: '人事代理统计',
				            icon:"<%=contextPath%>/images/hangye.png",
				            handler:function() {
				            	if(!Validator.Validate(frmM,2)){
				  					return false;
			  					}
  								rsdljl();
				            
				            }
 						},'-',{
				            text: '删除',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:deleteIt
				        },'-',
				        {
				            text: '清空',
				            icon:"<%=contextPath%>/images/clear.png",
				            handler:resetForm
				        },'->',
				        {
				            text: '查询条件',
				            icon:"<%=contextPath%>/images/down_bottom.gif",
				            handler:displayquerydiv
				        }
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
		<s:hidden name="searchBean.displayFlag" />
			<table width="100%" id="contab">
				<tbody id="querydiv">
				<tr>
					<th>
						<center>统计日期：</center>
					</th>
					<td>
						<input type="text" size="12" datatype="Require" readonly="true" name="searchBean.con2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" id="searchBean.con2" value="${searchBean.con2}" msg="统计日期开始必须输入。"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						~
						&nbsp;
						<input type="text" size="12" datatype="Require" readonly="true" name="searchBean.con3"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" id="searchBean.con3" value="${searchBean.con3}" msg="统计日期结束必须输入。"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
				</tr>
				</tbody>
			</table>
			<hr>


			<table width="100%" id="listtab">
				<tr>
					<th   width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</th>
					<th   width="300">统计日期范围</th>
					<th   width="200">统计类型</th>
					<th >统计文件</th>
				</tr>

				<c:forEach items="${list}" var="detail" >
					<tr>
						<td  width="25">
							<input type="checkbox" name="id" value="${detail.id}" />
						</td>
						<td width="300">&nbsp;<c:out value="${detail.tjsj}" /></td>
						<td width="200">&nbsp;<c:out value="${detail.filenamecn}" /></td>
						<td >
							<a href="#" onClick="javascript:downfile('<c:out value="${detail.id}"/>')" >
								下载
							</a>
						</td>
					</tr>
				</c:forEach>
				
				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="7" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<table width="100%" id="tablestyle2">
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>

			<div id="main-div" scrolling="no" style= "overflow:hidden" >
				<center><iframe id= "jxcp" src="" scrolling="no" frameborder="no" width="95%" height="60%" ></iframe></center>
			</div>
		</form>
	</body>
</html>
<script language="javascript">

			// 统计
			function jl(){
				//Ext.MessageBox.show({ title:'请等待', msg:'数据统计中……', width:200,  closable:false });
				//document.getElementById("gzltj").src = "<%=contextPath%>/searchGzltj!tongji.do?entity.tjsjks=" + document.frmM.elements["entity.tjsjks"].value + "&entity.tjsjjs=" + document.frmM.elements["entity.tjsjjs"].value;
				document.frmM.action = "<%=contextPath%>/jxcp!initTabDetail.do";
				document.frmM.submit();
			}
			// 人事代理统计
			function rsdljl(){
				document.frmM.action = "<%=contextPath%>/jxcprsdl!initTabDetail.do";
				document.frmM.submit();
			}
			
			// 查询
			function cmt(){
				document.frmM.action = "<%=contextPath%>/jxcpList!getList.do?page=1&c=c";
				document.frmM.submit();
			}
			
			// 下载
			function downfile(id) {
				document.getElementById("jxcp").src = "<%=contextPath%>/jxcp!fileDownload.do?id=" + id;
			}
			
			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		 		
		 		if(confirm("确定要删除记录吗？")) {
		    	
		        	document.frmM.action = "<%=contextPath%>/jxcp!delete.do";
					document.frmM.submit();
		    	}
			}
			
		</script>